package com.hygj.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hygj.pojo.UserRole;
import com.hygj.service.UserRoleService;
import com.hygj.util.PageUtil;

/**
 *用户--角色---关联关系
 * @author admin
 *
 */
@Controller
@RequestMapping
public class UserRoleController {
	
	
	@Autowired
	private UserRoleService userRoleService;
	
	
	@RequestMapping("userRoleInsert")
	public String userRoleInsert(UserRole userRole) {
		userRoleService.insert(userRole);
		return "redirect:/getUserRoleAll";
	}
	
	@RequestMapping("getUserRoleAll")
	public String getUserRoleAll(Map<String, Object> map, HttpServletRequest request) {
		Map<String, Object> params = new HashMap<String, Object>();
		PageUtil<UserRole> page = userRoleService.page(request, 10, params);
		map.put("page", page);
		return "logins/RoleShow";
	}
	
	
	

}
